#!/bin/bash

BADFILES=`find /cygdrive/c/Users/Owner/Pictures/ -iname *.avi -iname *.3gp -iname *.mp4`

if [[ $BADFILES != '' ]];then
	echo "Error. Following files are not Pictures and should be moved before syncing:"
	echo $BADFILES | sed 's/\.[aA][vV][iI] /&\n/g' | sed 's/\.3[gG][pP] /&\n/g' | sed 's/\.[mM][pP]4 /&\n/g' 
	exit 1
else
	echo "No files on the naughty (i.e. non-picture) list found. Proceeding..."
fi

rsync -rv --exclude '.*' --exclude '*.ini' --exclude '*.db' --delay-updates --delete-before /cygdrive/c/Users/Owner/Pictures/ /cygdrive/g/DCIM/Pictures